<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			p{
				font-size: 100px;
				border-radius: 10px;
				height: 200px;
				border: 1px solid red;
			}
		</style>
		<script>
			window.onload=function(){
				var b=document.getElementById("btn1");
				b.onclick=function(){
					var d=document.getElementById("d1");
					alert("边框："+d.style.border);
				}
				var b2=document.getElementById("btn2");
				b2.onclick=function(){
					var p2=document.getElementById("p2");
					//只能获得 行内样式
					//alert("字体大小："+p2.style.fontSize);
					var size=((p2.currentStyle)||(document.defaultView.getComputedStyle(p2,null))).fontSize;
					alert("字体："+size);
				}
			}
		</script>
	</head>
	<body>
		<div id="d1" style="font-size: 49px;height: 300px; border: 10px outset green;">
			<input type="button" value="获得样式" id="btn1"/>
		</div>
		<p id="p2">
			We change lives!
			<input type="button" id="btn2" value="获得样式"/
		</p>
	</body>
</html>
